package com.dadaguai.dto;

import com.dadaguai.common.validator.LoginGroup;
import com.dadaguai.common.validator.RegisterGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.GroupSequence;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
public class UserInfoDto {

    private String userId;
    /**
     * 昵称
     */
//    @NotEmpty(message = "昵称不能为空",groups = RegisterGroup.class)
//    @Size(min = 5,max = 10,message ="昵称长度为5-10个字符",groups = RegisterGroup.class)
    private String nickName;
    /**
     * 邮箱
     */
    @NotEmpty(message = "邮箱不能为空", groups = {RegisterGroup.class, LoginGroup.class})
    @Email(message = "邮箱格式错误", groups = {RegisterGroup.class, LoginGroup.class})
    private String email;
    /**
     * 密码
     */
//    @Size(min = 6,max = 20,message = "密码长度为6-20位字符",groups = {RegisterGroup.class})
    private String password;

    /**
     * 0:女 1:男
     */
    private Integer sex;
    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birth;
    /**
     * 验证码
     */
    @NotEmpty(message = "验证码不能为空", groups = {RegisterGroup.class})
    private String code;

    /**
     * 用户头像url
     */
    private String iconUrl;

    /**
     * 等级
     */
    private Integer level;
    /**
     * 积分
     */
    private Integer totalIntegral;

    /**
     * 当前积分
     */
    private Integer currentIntegral;
    /**
     * 个人描述
     */
    private String personDescription;

    /**
     * 加入时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date joinTime;

    /**
     * 最后登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastLoginTime;
}
